The samples presented in this Chapter can be compiled either with Delphi 2.0 or with Delphi 1.0. Conditional compilation directives are used to resolve any version specific dependencies. If you compile with one version of Delphi, and load the project in the other version, be aware that you will most likely get an one or more initial warnings pertaining to the differences between the two version. You can ignore the warnings, save the whole project within the Delphi version you're using and then simply recompile.
Since the code has been written in a portable way, if you are using Delphi 2.0, make sure that the Environment Library Options define the following unit aliases:
If you have not changed Delphi 2.0's default configuration, then these unit aliases are already defined.
The samples in this chapter are about client/server database programming, and are all built with Delphi's Local Interbase Server. In order to compile or run this samples, you must first make sure that you have Local Interbase Server installed; if you don't have it, refer to Delphi's installation instructions.
If you follow the step by step instructions in this chapter, you will eventually end up creating a new Interbase database, called CSHOWTO.GDB and placed in this chapters home directory (C:\DDS\CHAP08 if you have placed the default directories on drive C: - if you have a different directory setup, make changes accordingly).
If you just want to try out the samples, without following the step by step instructions, you need first to create the sample database (C:\DDS\CHAP08\CSHOWTO.GDB), and then define one new alias called CSHOWTO, of type INTRBASE, pointing to the sample database C:\DDS\CHAP08\CSHOWTO.GDB. Detailed instructions for how to create the sample database and the alias are given in HowTo01. When defining the new alias you also need to indicate a username. In HowTo01 you will also find instructions on how to define a new username/password combination to gain access to the new database. If you don't follow the steps, but intend to use the sample CSHOWT.GDB database, then you can use the following username/password combinations to access it:
Username Password
-------- --------------
SYSDBA masterkey
STENDON spaghetticoder
Note that the password is case sensitive (and only the first eight characters of the password are significant).
If you are rebuilding the sample database, and want to try out HowTo04 "Generate unique keys in Interbase tables", you must first run the C:\CHAP08\HOWTO05\UNIQKEY\UNIQKEY.SQL script file. Detailed instructions are given in the text of HowTo04. Be aware that the script hard codes a reference to C:\DDS\CHAP08\CSHOWTO.GDB. If you created the database in some other drive or directory, then you need to change the script accordingly.
If you are rebuilding the sample database, and want to try out HowTo05 "Deal with multiple transactions (and generate unique keys on any SQL database)", you must first create two tables in the database: PROGRAM and KEYTABLE. You can do so by running the C:\CHAP08\HOWTO05\MTRANS\MTRANS.SQL script file. Detailed instructions are given in the text of HowTo05. Be aware that the script hard codes a reference to C:\DDS\CHAP08\CSHOWTO.GDB. If you created the database in some other drive or directory, then you need to change the script accordingly.